package org.oos.dao;

import org.oos.data.Service;
import org.oos.services.util.AtomUtils;
import org.w3c.dom.Element;

public abstract class ServiceDao
{
	AtomUtils atom;
	public ServiceDao()
	{
		atom = new AtomUtils();
	}
	
	protected void populateCommonfields(Service service, Element entry) throws Exception
	{
		service.id = new Integer(atom.getElementValue(entry, "oos:id"));
		service.name = atom.getElementValue(entry, "title");
		service.phone = atom.getElementValue(entry, "oos:telephone");
		service.location = atom.parseLocation(entry);
		service.externalUrl = atom.getElementValue(entry, "oos:url");
		service.url = atom.getElementValue(entry, "link", "alternate");
	}
}
